package com.yunlankeji.stemcells.fragemt.home;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.yunlankeji.ganxibaozhijia.R;
import com.yunlankeji.stemcells.adapter.Expert_databaseAdapter;
import com.yunlankeji.stemcells.model.request.Expert_database;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class fragment_home_organization_expert extends Fragment {
    private Unbinder unbinder;
    @BindView(R.id.rv_organization_expert)
    RecyclerView rv_organization_expert;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view=inflater.inflate(R.layout.fragment_home_organization_expert,container,false);

        rv_organization_expert = view.findViewById(R.id.rv_organization_expert);
        List<Expert_database> expert_databasesList = new ArrayList<>();

        unbinder= ButterKnife.bind(this,view);


        Expert_database expert_database1 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database2 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database3 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database4 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database5 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database6 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database7 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database8 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database9 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database10 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);
        Expert_database expert_database11 = new Expert_database("123","123","生物化学及分子生物学博士， 中国医药学专家，专治各种疑难杂症",R.mipmap.icon_expert);

        expert_databasesList.add(expert_database1);
        expert_databasesList.add(expert_database2);
        expert_databasesList.add(expert_database3);
        expert_databasesList.add(expert_database4);
        expert_databasesList.add(expert_database5);
        expert_databasesList.add(expert_database6);
        expert_databasesList.add(expert_database7);
        expert_databasesList.add(expert_database8);
        expert_databasesList.add(expert_database9);
        expert_databasesList.add(expert_database10);
        expert_databasesList.add(expert_database11);
        GridLayoutManager gridLayoutManager=new GridLayoutManager(getContext(),3);
        rv_organization_expert.setLayoutManager(gridLayoutManager);
        Expert_databaseAdapter expert_databaseAdapter= new Expert_databaseAdapter(expert_databasesList);

        rv_organization_expert.setAdapter(expert_databaseAdapter);

        return view;
    }
}
